Skip to content

New Group Sync for GN#350

Merged
f-necas merged 8 commits into
georchestra-gn4.4.xfrom
roles-org
May 20, 2026
Merged

New Group Sync for GN#350
f-necas merged 8 commits into
georchestra-gn4.4.xfrom
roles-org

Conversation

@f-necas

@f-necas f-necas commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator

I introduce here a new synchronization for geonetwork in georchestra in order to solve the current situation of:

  • Org based sync is not granular enough to be able to give a user rights in different groups
  • Role based sync is not understable enough and we easily lose track of what is synced between georchestra's console and GN

How does it work

This new sync works (almost) like Org based sync. Organization in georchestra are mapped to GN groups.

But, we can also create new roles in georchestra like PSC:GN_REVIEWER which will allow user to be REVIEWER of PSC group.

In this way, we can set multiple and differents rights for user like PSC:GN_REVIEWER, C2C:GN_EDITOR and so on.

Top level roles like GN_EDITOR, GN_REVIEWER set this role for organization/group where user belongs to (just as org based sync).

Requires: georchestra/georchestra#4616
and georchestra/georchestra#4656

Examples

User Profile in GN Roles in GN
Organization PSC, Roles: ROLE_USER Guest No group attribution
No Organization , Roles: GN_EDITOR Editor No group attribution
Organization PSC , Roles: GN_EDITOR Editor Editor in PSC Group
Organization PSC , Roles: GN_EDITOR, C3P:GN_REVIEWER Reviewer Editor in PSC Group, Reviewer in C3P Group
No Org, Roles: GN_ADMIN Administrator Admin in all groups

GIP: georchestra/improvement-proposals#16

@f-necas f-necas changed the title roles-org New Group Sync for GN Dec 18, 2025
@f-necas
f-necas requested review from a team, jeanpommier, landryb and pmauduit December 19, 2025 07:13
@f-necas
f-necas marked this pull request as ready for review December 19, 2025 07:13
@fvanderbiest

Copy link
Copy Markdown
Member

I like the fact that this is an extension of the org-based sync.
As I understand it, it changes nothing for those who do not need it.

Can you explain whether this will be be a new option for the geonetwork.syncMode setting or a replacement of the orgs sync mode ?
https://github.com/georchestra/datadir/blob/92dd72bd7911f38da0779ea8474572af89abed9a/geonetwork/geonetwork.properties#L25-L32

@fvanderbiest

Copy link
Copy Markdown
Member

If the community agrees on this move, it has to be properly documented in addition to this PR.

@jeanpommier

Copy link
Copy Markdown
Member

Looks very interesting indeed.
Sorry, I won't have time to look at the code right now

@landryb

landryb commented Dec 19, 2025

Copy link
Copy Markdown
Member

i dont understand much of it but i dont have the time to properly look, but shouldnt the 'profile in GN' be Editor in the 4th line in the example ? per 'Organization PSC , Roles: GN_EDITOR, C3P:GN_REVIEWER'.. or it has to be 'the higher profile' ?

@f-necas

f-necas commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator Author

i dont understand much of it but i dont have the time to properly look, but shouldnt the 'profile in GN' be Editor in the 4th line in the example ? per 'Organization PSC , Roles: GN_EDITOR, C3P:GN_REVIEWER'.. or it has to be 'the higher profile' ?

We compute the highest profile in order for the user to have the right minimal profile according to their roles.

If the community agrees on this move, it has to be properly documented in addition to this PR.

Yep wanted to do so but I didn't remembered some things I did. It was a shot i gave a few months ago...

Can you explain whether this will be be a new option for the geonetwork.syncMode setting or a replacement of the orgs sync mode ? georchestra/datadir@92dd72b/geonetwork/geonetwork.properties#L25-L32

Sure will do, if community agrees

@fvanderbiest

Copy link
Copy Markdown
Member

I think this deserves a GIP :-)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new role_per_org group synchronization strategy for GeoNetwork/geOrchestra integration to support granular per-organization group privileges via prefixed roles (e.g. PSC:GN_REVIEWER), while keeping org-based mapping for “root” roles.

Changes:

  • Introduces GroupSyncMode.role_per_org and a new RolePerOrgBasedGroupSynchronizer implementation, wired via GroupSynchronizerProxy.
  • Deprecates the existing roles-based group synchronizer class (annotation) and adjusts integration test support to compute user profile using “root roles” provided by the active synchronizer.
  • Adds a new integration test covering the new sync mode.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
georchestra-integration/externalized-accounts/src/test/java/org/geonetwork/security/external/integration/RolePerOrgBasedSynchronizationIT.java New integration test exercising the new sync mode and prefixed role behavior.
georchestra-integration/externalized-accounts/src/test/java/org/geonetwork/security/external/integration/IntegrationTestSupport.java Updates profile assertion to use synchronizer-provided “root roles” for profile resolution.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/model/GroupSyncMode.java Adds the role_per_org sync mode (and marks roles as deprecated in a comment).
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/RolesBasedGroupSynchronizer.java Marks the old roles-based synchronizer class as @Deprecated.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/RolePerOrgBasedGroupSynchronizer.java New synchronizer implementing org group mapping + prefixed-role per-group privileges.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/IntegrationConfiguration.java Registers the new synchronizer as a Spring bean.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/GroupSynchronizerProxy.java Routes role_per_org mode to the new synchronizer and delegates getRootRolesForUser.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/GroupSynchronizer.java Adds getRootRolesForUser to the interface.
georchestra-integration/externalized-accounts/src/main/java/org/geonetwork/security/external/integration/AbstractGroupSynchronizer.java Provides a default getRootRolesForUser implementation (returns raw roles).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@f-necas
f-necas force-pushed the georchestra-gn4.4.x branch from 3ccd214 to d9c1071 Compare May 13, 2026 12:16
@f-necas
f-necas merged commit 9cdc0b1 into georchestra-gn4.4.x May 20, 2026
1 check passed
@f-necas
f-necas deleted the roles-org branch May 20, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants